package my.app.com.taobao.forfun.getqueryresult;

import org.junit.Test;
public class GetValueOfQueryTest {
	private GetValueOfQuery query = new GetValueOfQuery();
	/**
	 * Test For 淘宝产品数
	 */
	@Test
	public void getValueTest1() {
		pl(query.getValeuOfQuery("http://s.taobao.com/search?q={product}", "%C3%AB%B1%CA", "找到相关宝贝<em>", "</em>件</div>"));
	}
	
	/**
	 * Test for 商场产品数
	 */
	@Test 
	public void getValueTest2() {
		pl(query.getValeuOfQuery("http://s.taobao.com/search?q={product}&tab=mall", "%C3%AB%B1%CA", "找到相关宝贝<em>", "</em>件</div>"));
	}
	
	/**
	 * Test for 淘宝店铺数
	 */
	@Test
	public void getValueTest3() {
		pl(query.getValeuOfQuery("http://shopsearch.taobao.com/browse/shop_search.htm?shopf=newsearch&q={product}&tag=tag&tab=4&s=0", "%C3%AB%B1%CA", "所有店铺(", ")"));
	}
	
	
	/**
	 * Test for 商场店铺数
	 */
	@Test
	public void getValueTest4() {
		pl(query.getValeuOfQuery("http://shopsearch.taobao.com/browse/shop_search.htm?shopf=newsearch&stat=5&cattype=1&q={product}&cat=&catName=%CB%F9%D3%D0%C0%E0%C4%BF&rootCat=&tag=tag&filterShopType1=1&tab=4", "%C3%AB%B1%CA", "所有店铺(", ")"));
	}
	
	@Test
	public void getValueTest5() {
		pl(query.getValeuOfQuery("http://search.china.alibaba.com/selloffer/-{product}.html?biztype=2&uniqfield=userid", "%C3%AB%B1%CA".replace("%", ""), "已合并成<em>", "<"));
	}
	
	@Test
	public void getBaiduIndex() {
		query.getValeuOfQuery("http://index.baidu.com/main/word.php?word={product}", "%BF%AA%C9%C0", "1", "2");
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
}
